<?php

mysql_connect("localhost", "root", "babu9231") or die(mysql_error());
mysql_select_db("bullying") or die(mysql_error());

$nome = $_POST['nome'];

$sql = "SELECT * FROM bater WHERE nome = '$nome' ";
$qr = mysql_query($sql) or die(mysql_error());

if(mysql_num_rows($qr) == 0){
   echo  'Erro';
   
}
else{
   while($ln = mysql_fetch_assoc($qr)){
      echo 	'<center><table width="200" border="2" cellspacing="0" cellpadding="1">
	<tr><th scope="row">Energia Necessaria</th><td>'.$ln['energia'].'</div></tr>'.
	'<tr><th scope="row">Moral Necessaria</th><td>'.$ln['moral'].'</div></tr>'.
	'<tr><th scope="row">Grana</th><td>'.$ln['grana'].'</div></tr>'.'</table></center>';
	}
}
?>
